MGMT-23515: Use Network type support level#3465
MGMT-23515: Use Network type support level#3465openshift-merge-bot[bot] merged 3 commits intoopenshift-assisted:masterfrom
Conversation
|
@LiorSoffer: This pull request references MGMT-23515 which is a valid jira issue. Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the bug to target the "4.22.0" version, but no target version was set. DetailsIn response to this: Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (15)
💤 Files with no reviewable changes (3)
✅ Files skipped from review due to trivial changes (7)
🚧 Files skipped from review as they are similar to previous changes (2)
📝 WalkthroughWalkthroughNetwork-type identifiers, labels, and third‑party CNI logic were moved into a new Changes
Sequence Diagram(s)sequenceDiagram
participant UI as NetworkConfiguration UI
participant Dropdown as NetworkTypeDropdown
participant FeatureSvc as FeatureSupportLevelService
participant Cluster as Cluster State
UI->>Cluster: provide cluster context (isSNO, stackType, viewerMode)
UI->>Dropdown: render with featureSupportLevelData
Dropdown->>FeatureSvc: getFeatureSupportLevel(NETWORK_TYPE_FEATURE_IDS[value])
FeatureSvc-->>Dropdown: supportLevel
Dropdown->>Dropdown: compute disabledReason via getFeatureDisabledReason(featureId, featureSupportLevelData)
alt disabled (unavailable/unsupported)
Dropdown->>Cluster: set field value to NETWORK_TYPE_OVN (fallback)
end
Dropdown->>UI: render items with NewFeatureSupportLevelBadge and aria-disabled state
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In
`@libs/ui-lib/lib/ocm/components/clusterConfiguration/networkConfiguration/NetworkTypeDropdown.tsx`:
- Around line 94-96: The badge is passed featureId={value} but supportLevel was
derived from the mapped feature id used earlier; update the
NewFeatureSupportLevelBadge call to pass the same mapped feature-id variable
that you used to compute supportLevel (i.e., replace featureId={value} with
featureId={the mapped feature id variable used on lines 80–83}) so the badge
identity and supportLevel are consistent, keeping the existing onClick
event.stopPropagation wrapper intact.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 34f5c746-03c0-488c-aed0-a7c7c152d49f
📒 Files selected for processing (1)
libs/ui-lib/lib/ocm/components/clusterConfiguration/networkConfiguration/NetworkTypeDropdown.tsx
.../ui-lib/lib/ocm/components/clusterConfiguration/networkConfiguration/NetworkTypeDropdown.tsx
Show resolved
Hide resolved
|
/cherry-pick releases/v2.51 |
|
@LiorSoffer: once the present PR merges, I will cherry-pick it on top of DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
.../ui-lib/lib/ocm/components/clusterConfiguration/networkConfiguration/NetworkTypeDropdown.tsx
Show resolved
Hide resolved
.../ui-lib/lib/ocm/components/clusterConfiguration/networkConfiguration/NetworkTypeDropdown.tsx
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
♻️ Duplicate comments (1)
libs/ui-lib/lib/ocm/components/featureSupportLevels/featureStateUtils.ts (1)
198-200:⚠️ Potential issue | 🟠 MajorHandle the other network-type feature IDs here too.
NetworkTypeDropdown.tsxnow resolvesgetFeatureDisabledReason(...)for every entry inNETWORK_TYPE_FEATURE_IDS, but this switch only special-casesSDN_NETWORK_TYPE.OVN_NETWORK_TYPE,CISCO_ACI_NETWORK_TYPE,CILIUM_NETWORK_TYPE,CALICO_NETWORK_TYPE, andNONE_NETWORK_TYPEcurrently fall through toundefined, so unsupported/unavailable options stay selectable and the auto-fallback effect never runs.Possible fix
+const getGenericNetworkTypeDisabledReason = (isSupported: boolean) => + !isSupported ? 'This network type is not supported for the selected configuration.' : undefined; + export const getNewFeatureDisabledReason = ( featureId: FeatureId, cluster: Cluster | undefined, activeFeatureConfiguration: ActiveFeatureConfiguration, isSupported: boolean, @@ case 'SDN_NETWORK_TYPE': { return getSDNDisabledReason(cluster, isSupported); } + case 'OVN_NETWORK_TYPE': + case 'CISCO_ACI_NETWORK_TYPE': + case 'CILIUM_NETWORK_TYPE': + case 'CALICO_NETWORK_TYPE': + case 'NONE_NETWORK_TYPE': { + return getGenericNetworkTypeDisabledReason(isSupported); + } case 'NETWORK_TYPE_SELECTION': { return getNetworkTypeSelectionDisabledReason(cluster); }🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@libs/ui-lib/lib/ocm/components/featureSupportLevels/featureStateUtils.ts` around lines 198 - 200, The switch in getFeatureDisabledReason currently only handles 'SDN_NETWORK_TYPE' causing other entries from NETWORK_TYPE_FEATURE_IDS (OVN_NETWORK_TYPE, CISCO_ACI_NETWORK_TYPE, CILIUM_NETWORK_TYPE, CALICO_NETWORK_TYPE, NONE_NETWORK_TYPE) to fall through; update the switch inside getFeatureDisabledReason to handle each of those IDs and return the appropriate disabled-reason helper (e.g., getOVNDisabledReason, getCiscoACIDisabledReason, getCiliumDisabledReason, getCalicoDisabledReason, or a shared getNetworkDisabledReason) or create those helper functions if missing so NetworkTypeDropdown.tsx gets a non-undefined result for every network-type feature.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Duplicate comments:
In `@libs/ui-lib/lib/ocm/components/featureSupportLevels/featureStateUtils.ts`:
- Around line 198-200: The switch in getFeatureDisabledReason currently only
handles 'SDN_NETWORK_TYPE' causing other entries from NETWORK_TYPE_FEATURE_IDS
(OVN_NETWORK_TYPE, CISCO_ACI_NETWORK_TYPE, CILIUM_NETWORK_TYPE,
CALICO_NETWORK_TYPE, NONE_NETWORK_TYPE) to fall through; update the switch
inside getFeatureDisabledReason to handle each of those IDs and return the
appropriate disabled-reason helper (e.g., getOVNDisabledReason,
getCiscoACIDisabledReason, getCiliumDisabledReason, getCalicoDisabledReason, or
a shared getNetworkDisabledReason) or create those helper functions if missing
so NetworkTypeDropdown.tsx gets a non-undefined result for every network-type
feature.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: cd1d7a1d-ce91-4583-a487-af3fb08fdb3e
📒 Files selected for processing (13)
libs/ui-lib/lib/cim/components/ClusterDeployment/networkConfigurationValidation.tslibs/ui-lib/lib/common/components/clusterWizard/networkingSteps/NetworkTypeControlGroup.tsxlibs/ui-lib/lib/common/components/clusterWizard/networkingSteps/StackTypeControlGroup.tsxlibs/ui-lib/lib/common/components/clusterWizard/networkingSteps/VirtualIPControlGroup.tsxlibs/ui-lib/lib/common/config/constants.tslibs/ui-lib/lib/common/types/index.tslibs/ui-lib/lib/common/types/networkType.tslibs/ui-lib/lib/ocm/components/clusterConfiguration/manifestsConfiguration/CustomManifestsPage.tsxlibs/ui-lib/lib/ocm/components/clusterConfiguration/networkConfiguration/NetworkConfiguration.tsxlibs/ui-lib/lib/ocm/components/clusterConfiguration/networkConfiguration/NetworkTypeDropdown.tsxlibs/ui-lib/lib/ocm/components/clusterWizard/ClusterWizardContextProvider.tsxlibs/ui-lib/lib/ocm/components/featureSupportLevels/featureStateUtils.tslibs/ui-lib/lib/ocm/components/utils.ts
💤 Files with no reviewable changes (3)
- libs/ui-lib/lib/common/config/constants.ts
- libs/ui-lib/lib/ocm/components/clusterConfiguration/networkConfiguration/NetworkConfiguration.tsx
- libs/ui-lib/lib/ocm/components/utils.ts
✅ Files skipped from review due to trivial changes (7)
- libs/ui-lib/lib/common/components/clusterWizard/networkingSteps/VirtualIPControlGroup.tsx
- libs/ui-lib/lib/cim/components/ClusterDeployment/networkConfigurationValidation.ts
- libs/ui-lib/lib/common/types/index.ts
- libs/ui-lib/lib/ocm/components/clusterConfiguration/manifestsConfiguration/CustomManifestsPage.tsx
- libs/ui-lib/lib/ocm/components/clusterWizard/ClusterWizardContextProvider.tsx
- libs/ui-lib/lib/common/components/clusterWizard/networkingSteps/StackTypeControlGroup.tsx
- libs/ui-lib/lib/common/components/clusterWizard/networkingSteps/NetworkTypeControlGroup.tsx
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In
`@libs/ui-lib/lib/ocm/components/clusterConfiguration/networkConfiguration/NetworkTypeDropdown.tsx`:
- Around line 46-55: The effect in NetworkTypeDropdown.tsx that forces
setValue(NETWORK_TYPE_OVN) when getFeatureDisabledReason(...) !== undefined
should early-return if the dropdown is disabled; modify the React.useEffect to
check the component's isDisabled prop (or the local variable controlling
disabled state) and skip calling setValue when isDisabled is true, so the effect
only updates Formik state when the control is interactive; keep the existing
checks on field.value, featureSupportLevelData, getFeatureDisabledReason and
only call setValue(NETWORK_TYPE_OVN) when the feature is unsupported AND
isDisabled is false.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 448d768a-ab8e-4da4-8f28-0e39bf5616b2
📒 Files selected for processing (13)
libs/ui-lib/lib/cim/components/ClusterDeployment/networkConfigurationValidation.tslibs/ui-lib/lib/common/components/clusterWizard/networkingSteps/NetworkTypeControlGroup.tsxlibs/ui-lib/lib/common/components/clusterWizard/networkingSteps/StackTypeControlGroup.tsxlibs/ui-lib/lib/common/components/clusterWizard/networkingSteps/VirtualIPControlGroup.tsxlibs/ui-lib/lib/common/config/constants.tslibs/ui-lib/lib/common/types/index.tslibs/ui-lib/lib/common/types/networkType.tslibs/ui-lib/lib/ocm/components/clusterConfiguration/manifestsConfiguration/CustomManifestsPage.tsxlibs/ui-lib/lib/ocm/components/clusterConfiguration/networkConfiguration/NetworkConfiguration.tsxlibs/ui-lib/lib/ocm/components/clusterConfiguration/networkConfiguration/NetworkTypeDropdown.tsxlibs/ui-lib/lib/ocm/components/clusterWizard/ClusterWizardContextProvider.tsxlibs/ui-lib/lib/ocm/components/featureSupportLevels/featureStateUtils.tslibs/ui-lib/lib/ocm/components/utils.ts
💤 Files with no reviewable changes (3)
- libs/ui-lib/lib/ocm/components/utils.ts
- libs/ui-lib/lib/ocm/components/clusterConfiguration/networkConfiguration/NetworkConfiguration.tsx
- libs/ui-lib/lib/common/config/constants.ts
✅ Files skipped from review due to trivial changes (9)
- libs/ui-lib/lib/common/components/clusterWizard/networkingSteps/VirtualIPControlGroup.tsx
- libs/ui-lib/lib/common/types/index.ts
- libs/ui-lib/lib/ocm/components/clusterWizard/ClusterWizardContextProvider.tsx
- libs/ui-lib/lib/common/components/clusterWizard/networkingSteps/NetworkTypeControlGroup.tsx
- libs/ui-lib/lib/ocm/components/clusterConfiguration/manifestsConfiguration/CustomManifestsPage.tsx
- libs/ui-lib/lib/common/components/clusterWizard/networkingSteps/StackTypeControlGroup.tsx
- libs/ui-lib/lib/ocm/components/featureSupportLevels/featureStateUtils.ts
- libs/ui-lib/lib/common/types/networkType.ts
- libs/ui-lib/lib/cim/components/ClusterDeployment/networkConfigurationValidation.ts
.../ui-lib/lib/ocm/components/clusterConfiguration/networkConfiguration/NetworkTypeDropdown.tsx
Show resolved
Hide resolved
jgyselov
left a comment
There was a problem hiding this comment.
See if you can simplify the imports 🙂
If we kept importing like this, we'd end up with hundreds of lines of imports and no-one wants that.
libs/ui-lib/lib/cim/components/ClusterDeployment/networkConfigurationValidation.ts
Outdated
Show resolved
Hide resolved
libs/ui-lib/lib/common/components/clusterWizard/networkingSteps/StackTypeControlGroup.tsx
Outdated
Show resolved
Hide resolved
libs/ui-lib/lib/common/components/clusterWizard/networkingSteps/VirtualIPControlGroup.tsx
Outdated
Show resolved
Hide resolved
...i-lib/lib/ocm/components/clusterConfiguration/manifestsConfiguration/CustomManifestsPage.tsx
Outdated
Show resolved
Hide resolved
libs/ui-lib/lib/ocm/components/clusterWizard/ClusterWizardContextProvider.tsx
Outdated
Show resolved
Hide resolved
.../ui-lib/lib/ocm/components/clusterConfiguration/networkConfiguration/NetworkTypeDropdown.tsx
Show resolved
Hide resolved
|
/retest |
Signed-off-by: Lior Soffer <liorsoffer1@gmail.com>
Signed-off-by: Lior Soffer <liorsoffer1@gmail.com>
Signed-off-by: Lior Soffer <liorsoffer1@gmail.com>
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: jgyselov, LiorSoffer The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
1115aba
into
openshift-assisted:master
|
@LiorSoffer: new pull request created: #3480 DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
https://redhat.atlassian.net/browse/MGMT-23515
Summary by CodeRabbit
Updates
Bug Fixes